#include <stdio.h>

int k;
void MergeSort(int a[],int x,int y){
	int i,j,mid=(x+y)/2;
	int b[100];
	if (y-x>1){
		MergeSort(a,x,mid);
		MergeSort(a,mid,y);
		i=x;
		j=mid;
		k=0;
		while (i<mid || j<y){//666666
			if (j==y || (i<mid) && a[i]<a[j])
				b[k++]=a[i++];
			else 
				b[k++]=a[j++];
		}
		for (i=x,j=0;j<k;i++,j++)//666
			a[i]=b[j];
	}
}

int main(void){
	int a[6]={7,6,8,9,10,2};
	MergeSort(a,0,7);
	for (int i=1;i<k;i++)
		printf("%4d",a[i]);
	return 0;
}
